/**
 * Created by administrator on 2/21/14.
 */

import java.util.*;
import java.util.Collections;

class Main {
    public static void main(String[] args) {
//        Triangle tri1 = new Triangle();
//        tri1.print_only_one();
//        tri1.print_horizontal(8);
//        tri1.print_vertical(3);
//        tri1.print_right(3);

        Diamond dia1 = new Diamond();
//        dia1.print_isosceles(3);
        dia1.print_diamond(3);
        dia1.print_diamond_with_name(4, "Bill");

        FizzBuzz(100);
        generate(1);
        generate(30);
        generate(50);
    }

    public static void FizzBuzz(int n) {
        for (int i = 1; i < n+1; i++){
            boolean notFizzOrBuzz = true;
            if (i % 3 == 0) {
                System.out.print("Fizz");
                notFizzOrBuzz = false;
            }
            if (i % 5 == 0) {
                System.out.print("Buzz");
                notFizzOrBuzz = false;
            }
            if (notFizzOrBuzz) {
                System.out.print(i);
            }
            System.out.println();
        }
    }

    public static void generate(int n) {
        ArrayList <Integer> ListOfNumbers = new ArrayList <Integer> ();
        for (int i = 2; i <= n; i++) {
            while (n % i == 0) {
                ListOfNumbers.add(i);
                n /= i;
            }
        }
        Collections.reverse(ListOfNumbers);
        System.out.println(ListOfNumbers);
    }
}
